home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 139
/
(Vol 139) Sep 24 2011.iso
/
Games
/
kirby.swf
/
scripts
/
DefineSprite_162
/
frame_1
/
PlaceObject2_123_1
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2011-09-24
|
3KB
|
87 lines
onClipEvent(enterFrame){
if(_root.Level[eval("../:Name")]._x + _root.Level._x >= - RandM && _root.Movwidth + RandM >= _root.Level[eval("../:Name")]._x + _root.Level._x && _root.Level[eval("../:Name")]._y + _root.Level._y >= - RandM && _root.Movheight + RandM >= _root.Level[eval("../:Name")]._y + _root.Level._y && _root.Kirby.AttackDemo == "off" && _root.Level[eval("../:Name")]._visible == 1)
{
Y -= 1;
if(Y < - MaxY)
{
Y = - MaxY;
}
if(_root.Kirby.Spiting != eval("../:Name"))
{
var forvar = 1;
while(_root.Grounds >= forvar)
{
if(this.hit.hitTest(_root.Level["G" add forvar]))
{
if(_root.Level["G" add forvar]._y + MaxY >= _root.Level[eval("../:Name")]._y)
{
_root.Level[eval("../:Name")]._y = _root.Level["G" add forvar]._y;
Y = 0;
}
else
{
X *= -1;
}
}
forvar++;
}
var forvar = 1;
while(_root.Blocks >= forvar)
{
if(this.hit.hitTest(_root.Level["B" add forvar]) && _root.Level["B" add forvar]._visible == 1)
{
if(_root.Level["B" add forvar]._y + MaxY >= _root.Level[eval("../:Name")]._y)
{
_root.Level[eval("../:Name")]._y = _root.Level["B" add forvar]._y - _root.Level["B" add forvar]._height / 2;
Y = 0;
}
else
{
X *= -1;
}
}
forvar++;
}
_root.Level[eval("../:Name")]._x += X;
_root.Level[eval("../:Name")]._y -= Y;
}
if(0 < X)
{
_root.Level[eval("../:Name")]._xscale = -100;
}
else
{
_root.Level[eval("../:Name")]._xscale = 100;
}
if(On != "off2")
{
On = "on";
}
}
else
{
if(On == "on" && _root.Level[eval("../:Name")]._visible == 0)
{
duplicateMovieClip(_root.Level.Puffeffect,"Peffect1",16584);
_root.Level.Peffect1._x = _root.Level[eval("../:Name")]._x;
_root.Level.Peffect1._y = _root.Level[eval("../:Name")]._y - 10;
}
On = "off";
if(- RandL >= StartX + _root.Level._x || StartX + _root.Level._x >= _root.Movwidth + RandL || - RandL >= StartY + _root.Level._y || StartY + _root.Level._y >= _root.Movheight + RandL)
{
_root.Level[eval("../:Name")]._visible = 1;
_root.Level[eval("../:Name")]._x = StartX;
_root.Level[eval("../:Name")]._xscale = StartXscale;
_root.Level[eval("../:Name")]._y = StartY;
if(0 < StartXscale)
{
X = - Speed;
}
else
{
X = Speed;
}
}
}
}